package com.shawn.model.vo;

import com.shawn.model.entity.BlackList;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.annotations.Update;

import java.io.Serializable;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class PageResult<T> implements Serializable {

    private Integer counts=0;//总记录数

    private Integer pagesize=10;//每页显示数量

    private Integer pages=0;//总页数

    private Integer page=1;//当前页

    private List<T> items;//数据

    public PageResult(Integer page,Integer pagesize,Integer counts,List<T> list) {
        this.page = page;
        this.pagesize = pagesize;
        this.items = list;
        this.counts = counts;
        this.pages = counts % pagesize == 0 ? counts / pagesize : counts / pagesize + 1;
    }

}
